Fix broken update handling of path-based routes#21877
Fix broken update handling of path-based routes#21877openshift-merge-robot merged 1 commit intoopenshift:release-3.11from
Conversation
When an existing route's path is updated to a new value not previously observed,
the new route state is correctly activated, but the previous route is not
replaced in the `hostRules` internal active list. Instead, the updated route
state (with a different path but duplicate UID) is appended to the active list.
A `hostRules` active list with more than one route instance sharing a UID and
host is an invalid internal state. The net effect is some unintended confusing
behavior which manifests when updating the route's path, including:
* Updating from path A->B->A preventing future transitions to B
* Updating from path A->B->A->B leaves an orphaned claim on the host in the
namespace, preventing the recreation of the route with either of the previously
observed paths until the router is restarted (causing the internal state to be
rebuilt)
Routes updates which are affected by this bug will be rejected with a status
like:
message: route foo already exposes foo-ns.os.example.com and is older
reason: HostAlreadyClaimed
Where `foo` refers to itself. This indicates the route update was rejected due
to a claim made by the same route being updated.
To fix the problem, ensure that when a path change is detected on the same route
the prior existing state is removed from the index, eliminating the possibility
of keeping an orphaned claim. Then add the new route as usual, which handles
acceptance/rejection normally.
|
/cc @openshift/sig-network-edge @smarterclayton |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ironcladlou, knobunc The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick 3.10 |
|
/cherry-pick release-3.10 |
|
/test extended_conformance_install |
|
/retest |
No idea on this one... /retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest |
1 similar comment
|
/retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest |
3 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
CI errors possibly fixed by openshift-eng/aos-cd-jobs#1688 |
|
/retest |
|
/cherrypick release-3.10 |
|
@stevekuznetsov: new pull request created: #21901 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
When an existing route's path is updated to a new value not previously observed,
the new route state is correctly activated, but the previous route is not
replaced in the
hostRulesinternal active list. Instead, the updated routestate (with a different path but duplicate UID) is appended to the active list.
A
hostRulesactive list with more than one route instance sharing a UID andhost is an invalid internal state. The net effect is some unintended confusing
behavior which manifests when updating the route's path, including:
Updating from path A->B->A preventing future transitions to B
Updating from path A->B->A->B leaves an orphaned claim on the host in the
namespace, preventing the recreation of the route with either of the previously
observed paths until the router is restarted (causing the internal state to be
rebuilt)
Routes updates which are affected by this bug will be rejected with a status
like:
Where
foorefers to itself. This indicates the route update was rejected dueto a claim made by the same route being updated.
To fix the problem, ensure that when a path change is detected on the same route
the prior existing state is removed from the index, eliminating the possibility
of keeping an orphaned claim. Then add the new route as usual, which handles
acceptance/rejection normally.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1660598